<template>
    <div class="i-tip">
        <div class="i-tip">父传子的值:{{info.like}}</div>
        <div class="i-tip">
            <el-button @click="send">传值</el-button>
        </div>
    </div>
</template>

<script>
    import {
        reactive
    } from "vue";
    export default {
        props: ["like"],
        emits: ["sendvalue"],
        setup(props, context) {
            console.log(context, "上下文环境对象")
            let info = reactive({
                like: props.like
            });
            // 编写传参函数
            function send() {
                context.emit("sendvalue", "今天是一个晴天")
            }
            return {
                info,
                send
            }
        }
    }
</script>

